﻿/*$j(document).ready(function() {
$j('#ulSubTopMenu').spasticNav();
$j(window).resize(function() { resizeMenu();  });
});*/
//document.write("<script type='text/javascript' src='http://apis.google.com/js/plusone.js' language='javascript'></script>"); //29.08.12
document.observe("dom:loaded", loadMain);
//var strPathLink_All = "http://www.nhommua.com/";
function loadMain() {
    /*01/11*/
    $j('#ulSubTopMenu').spasticNav();
    setTimeout(function () {
        $j("#blob").remove();
        $j('#ulSubTopMenu').spasticNav();
    }, 2000);
    /*end 01/11*/
    //hide share tam thoi
    if ($('dShare_Social')) {
        $j('#dShare_Social').css("display", "none");
    }
    //setSharePos();
    scrollShareSocial();
    reArrangeTitle_V4();
    reArrangeTitle_V4_SideDeal();
    scrollMenu();
    //$j('#ulSubTopMenu').spasticNav();
    //xy ly ham khi scroll man hinh
    window.onscroll = scrollMain;
    //xy ly ham khi resize man hinh
    window.onresize = resizeMain;
    //xu ly chay slide top 3 deal trang top deal
    if ($('slideFocusDeal') && $j('#slideFocusDeal div.gr-deal-focus').length > 1) {
        setTimeout("startTopDealSlide()", 5000);
    }
    //gan ham cho button slide top
    if ($j('#dButtonSlide_Cont')) {
        $j('#dButtonSlide_Cont li').click(selectTopSlide);
    }
    //change view mode
    if ($('aViewMode_Grid') && $('aViewMode_List')) {
        if (GetCookie("viewMode") != "list") {
            $('aViewMode_List').onclick = function () { changeViewMode("list"); };
        }
        else {
            $('aViewMode_Grid').onclick = function () { changeViewMode("grid"); };
        }
    }
    //click menu view list
    if ($("new")) {
        //$("money").onclick = loadProduct;
        $("fast").onclick = loadProduct;
        $("number").onclick = loadProduct;
        $("new").onclick = loadProduct;
    }
    //an loader hinh
    setTimeout("hideImgLoader_V4()", 3000);
    /*chay time count down*/
    try {
        if ($("dListDeal_DL")) {
            if (arrRemainTime.length > 0 && !$("ddlSL_Luxury")) {
                TimeCountDown_List(0);
            }
        }
        else if ($("divIMG")) {
            if (arrRemainTime.length > 0 && !$("ddlSL_Luxury")) {
                TimeCountDown_List(1);
            }
        }
    }
    catch (e) { }
    /*Set div quang cao*/
    if ($('dBanner')) {
        setDivQuangCao();
    }
    else if ($('dNewBanner_HotelTour_Top')) {
        setDivQuangCao_HotelTour();
    }
    else if ($('dNewBanner_DichVu_Top')) {
        setDivQuangCao_DichVu();
    }
    else if ($('dNewBanner_CafeAmThuc_Top')) {
        setDivQuangCao_CafeAmThuc();
    }
    else if ($('dNewBanner_SanPham_Top')) {
        setDivQuangCao_SanPham();
    }
    else if ($('dNewBanner_SpaLamDep_Top')) {
        setDivQuangCao_SpaLamDep();
    }
    /*show email gia tot bottom*/
    if ($('secEmail_Bot')) {
        setTimeout("$j('#secEmail_Bot').fadeIn();", 2000);
    }
    /*Insert Email Giá Tốt*/
    if ($('aBtnEmail_Bottom') && $("txtEmailBottom")) {
        $("txtEmailBottom").onkeypress = PressKey;
        $('aBtnEmail_Bottom').onclick = insertEmailNhanGiaTot;
    }
    /*set top cho share*/
    /*if ($('slideFocusDeal')) {
    $j('#dShare_Social').css({"top":"20px"});
    }
    else if ($('dDealInfo')) {
    $j('#dShare_Social').css({"top":"65px"});
    }*/
    if (isTouchDevice()) {
        var agent = window.navigator.userAgent,
        start = agent.indexOf('OS ');
        if ((agent.indexOf('iPhone') > -1 || agent.indexOf('iPad') > -1) && start > -1) {
            if ($('dBoxCityRunDeal') && $('hCityName')) {
                $('hCityName').onclick = function () {
                    if ($('dBoxCityRunDeal').style.opacity == "0") {
                        hideAllDropDown();
                        $j('#dBoxCityRunDeal').css({ "opacity": "1", "visibility": "visible" });
                    }
                    else {
                        hideAllDropDown();
                    }
                };
            }
            if ($('dPTGiaoHang') && $('spPTGiaoHang')) {
                $('spPTGiaoHang').onclick = function () {
                    if ($('dPTGiaoHang').style.opacity == "0") {
                        hideAllDropDown();
                        $j('#dPTGiaoHang').css({ "opacity": "1", "visibility": "visible" });
                    }
                    else {
                        hideAllDropDown();
                    }
                };
            }
            if ($('dTrangThai') && $('spTrangThai')) {
                $('spTrangThai').onclick = function () {
                    if ($('dTrangThai').style.opacity == "0") {
                        hideAllDropDown();
                        $j('#dTrangThai').css({ "opacity": "1", "visibility": "visible" });
                    }
                    else {
                        hideAllDropDown();
                    }
                };
            }
            if ($('dChuyenMuc') && $('spChuyenMuc')) {
                $('spChuyenMuc').onclick = function () {
                    if ($('dChuyenMuc').style.opacity == "0") {
                        hideAllDropDown();
                        $j('#dChuyenMuc').css({ "opacity": "1", "visibility": "visible" });
                    }
                    else {
                        hideAllDropDown();
                    }
                };
            }
        }
    }
    //22.10   
    if ($('aShowPopupLikeCart')) {
        $j('#aShowPopupLikeCart').click(showPopupLikeCart);
    }
    if ($('aClosePopupLikeCart')) {
        $j('#aClosePopupLikeCart').click(submitLikeCart);
    }
    if ($('btnLikeCart')) {
        $j('#btnLikeCart').click(submitLikeCart);
    }
    if ($('btnUnlikeCart')) {
        $j('#btnUnlikeCart').click(submitLikeCart);
    }
    if ($('spAjaxLoader')) {
        $j('#spAjaxLoader').css({ "height": $j('.mod-descriptions').height() + "px" });
    }
}
/****************Ham xu ly drop down touch***********/
function isTouchDevice() {
    return (typeof (window.ontouchstart) != 'undefined') ? true : false;
}
function hideAllDropDown() {
    if ($('dBoxCityRunDeal') && $('hCityName')) {
        $j('#dBoxCityRunDeal').css({ "opacity": "0", "visibility": "hidden" });
    }
    if ($('dPTGiaoHang') && $('spPTGiaoHang')) {
        $j('#dPTGiaoHang').css({ "opacity": "0", "visibility": "hidden" });
    }
    if ($('dTrangThai') && $('spTrangThai')) {
        $j('#dTrangThai').css({ "opacity": "0", "visibility": "hidden" });
    }
    if ($('dChuyenMuc') && $('spChuyenMuc')) {
        $j('#dChuyenMuc').css({ "opacity": "0", "visibility": "hidden" });
    }
}
/*document.observe('click', docClick);
function docClick() {
if (isTouchDevice()) {
hideAllDropDown();
}
}*/
/****************Ham xu ly scroll*****************/
function scrollMain() {
    if ($('dTopSubMenu')) {
        scrollMenu();
    }
    scrollShareSocial();
    if ($j(window).scrollTop() > 0) {
        $j("#dvBackToTop").stop(true, true).fadeIn();
    }
    if ($j(window).scrollTop() == 0) {
        $j("#dvBackToTop").stop(true, true).fadeOut();
    }
}
function resizeMain() {
    resizeMenu();

    if ($('dBanner')) {
        setDivQuangCao();
    }
    else if ($('dNewBanner_HotelTour_Top')) {
        setDivQuangCao_HotelTour();
    }
    else if ($('dNewBanner_DichVu_Top')) {
        setDivQuangCao_DichVu();
    }
    else if ($('dNewBanner_CafeAmThuc_Top')) {
        setDivQuangCao_CafeAmThuc();
    }
    else if ($('dNewBanner_SanPham_Top')) {
        setDivQuangCao_SanPham();
    }
    else if ($('dNewBanner_SpaLamDep_Top')) {
        setDivQuangCao_SpaLamDep();
    }

    if ($('dNewBanner')) {
        setDivQuangCao_New();
    }
    if ($('dLanding') && $j("#dLanding:hidden").length == 0) {
        if ($('dLadingPage_1')) {
            setPopUpCenter('dLadingPage_1');
        }
        if ($('dLadingPage_2')) {
            setPopUpCenter('dLadingPage_2');
        }
        if ($('dLadingPage_3')) {
            setPopUpCenter('dLadingPage_3');
        }
    }
    if ($('ulListSideDeal')) {
        setListSideDealHeight(isLoadMoreSideDeal);
    }
    if ($("dMap")) {
        loadMap();
    }
    if ($('liCondition') && $('liHighlight') && $j('#pLoadMore_DieuKien').is(":visible") == true) {
        loadMoreCondition();
    }
    else if ($('liCondition') && $('liHighlight') && $j('#pLoadMore_DieuKien').is(":visible") == false) {
        $j('#highlights-deal').removeAttr("style");
    }
    reArrangeTitle_V4();
    reArrangeTitle_V4_SideDeal();
    if ($('dShare_Social')) {
        scrollShareSocial();
    }
    if ($('dList_SP')) {
        setPopUpCenter('dList_SP');
    }
    if ($('slideFocusDeal') && $('dSlideTop3Deal_Cont')) {
        setTopSlideMargin();
    }
    if ($('dPopupBooking') && $j('#dPopupBooking').is(":hidden") == false) {
        setPopupBookingCenter();
    }
    if ($('dRedeal')) {
        setPopUpCenter("dRedeal");
    }
    if ($('dPopupLikeCart') && $j('#dPopupLikeCart').is(':hidden') == false) {
        setPopUpCenter('dPopupLikeCart');
    }
    if ($('spAjaxLoader')) {
        $j('#spAjaxLoader').css({ "height": $j('.mod-descriptions').height() + "px" });
    }

}
var large = false;
var medium = false;
var small = false;
function resizeMenu() {

    var width = $j(window).width();
    var num = 0;
    if (width >= 1218) {
        num = 0;
    }
    else if (width < 1218 && width >= 978) {
        // medium = true;
        num = 1;
    } else if (width < 978) {
        //small = true;
        num = 2;
    }

    switch (num) {
        case 0:
            if (large == false) {
                $j("#blob").remove();
                $j('#ulSubTopMenu').spasticNav();
                large = true; medium = false; small = false;
            }

            break;
        case 1:
            if (medium != true) {
                $j("#blob").remove();
                $j('#ulSubTopMenu').spasticNav();
                large = false;
                medium = true;
                small = false;
            }
            break;
        case 2:
            if (small != true) {
                $j("#blob").remove();
                $j('#ulSubTopMenu').spasticNav();
                large = false;
                medium = false;
                small = true;
            }
            break;
    }
}
/*************************Ham Chay Time count down*********************************/
var time;
var strTimeCountDown = "";
var days = 0,
    hours = 0,
	mins = 0,
	secs = 0;
function TimeCountDown_List(isDetail) {
    try {
        for (var i = 0; i < arrRemainTime.length; i++) {

            if (parseInt(arrRemainTime[i]) > 0) {
                arrRemainTime[i] = arrRemainTime[i] - 1000;
                if (parseInt(arrRemainTime[i]) <= 0) {
                    window.location = window.location.href;
                }
                else {
                    hours = parseInt(arrRemainTime[i] / 3600000);
                    mins = parseInt((arrRemainTime[i] - (hours * 3600000)) / 60000);
                    secs = parseInt((arrRemainTime[i] - (hours * 3600000) - (mins * 60000)) / 1000);

                    if (isDetail == 0) {
                        strTimeCountDown = hours + " giờ " + mins + " phút " + secs + " giây";
                        $("Time_CountDown_" + arrIDSP[i]).innerHTML = strTimeCountDown;
                    }
                    else if (isDetail == 1) {

                        days = parseInt(arrRemainTime[i] / 86400000);
                        hours = parseInt((arrRemainTime[i] - (days * 86400000)) / 3600000);
                        mins = parseInt((arrRemainTime[i] - (days * 86400000) - (hours * 3600000)) / 60000);
                        secs = parseInt((arrRemainTime[i] - (days * 86400000) - (hours * 3600000) - (mins * 60000)) / 1000);

                        $("Time_CountDown_" + arrIDSP[0]).innerHTML = "<i>" + ((days < 10) ? "0" + days : days) + "</i>" +
                                    "<i>" + ((hours < 10) ? "0" + hours : hours) + "</i>" +
                                    "<i>" + ((mins < 10) ? "0" + mins : mins) + "</i>" +
                                    "<i>" + ((secs < 10) ? "0" + secs : secs) + "</i>";
                        strTimeCountDown = ((days < 10) ? ("0" + days.toString()) : days.toString()) +
                                            ":" + ((hours < 10) ? ("0" + hours.toString()) : hours.toString()) +
                                            ":" + ((mins < 10) ? ("0" + mins.toString()) : mins.toString()) +
                                            ":" + ((secs < 10) ? ("0" + secs.toString()) : secs.toString());
                        //$("Time_CountDown_" + arrIDSP[1]).innerHTML = strTimeCountDown;
                    }

                }
            }
        }
        time = setTimeout("TimeCountDown_List(" + isDetail + ")", 1000);
    } catch (e) { console.log(e); }
}
/*************************Ham Insert Email Nhan Gia Tot*****************************/
function insertEmailNhanGiaTot() {
    if (checkMail($("txtEmailBottom").value) == true) {
        $("txtEmailBottom").onkeypress = "";
        if ($("aBtnEmail_Bottom")) {
            $("aBtnEmail_Bottom").onclick = "";
        }
        var strUrlLocation = window.location.href;
        strUrlLocation = strUrlLocation.replace('tp-ho-chi-minh/', '').replace('ha-noi/', '');
        var strUrlLink = strPathLink_All.replace('tp-ho-chi-minh/', '').replace('ha-noi/', '');
        if (strUrlLocation.toLowerCase().indexOf("/yahoo/") != -1) {
            strUrlLink = strPathLink_All + "yahoo/";
        }
        utils.call(strUrlLink + strStateNM + "/mua-hang-gia-re.html", { "flag": "InsertEmailNhanGiaTot", "email": $("txtEmailBottom").value, "city": strStateNM }, "POST", "insertEmailGiaTotResult", "insertEmailGiaTotResult");
        //utils.call("http://localhost:50606/NhomMuaV4/Index_new.aspx", { "flag": "InsertEmailNhanGiaTot", "email": $("txtEmailBottom").value, "city": strStateNM }, "POST", "insertEmailGiaTotResult", "insertEmailGiaTotResult");
    }
    else {
        var msg = (utils.trim($('txtEmailBottom').value) == "") ? "Bạn chưa nhập địa chỉ email" : "Email không đúng định dạng";
        try {
            showPopupErrorEmail_V4(msg);
        }
        catch (e) {
            console.log(e);
        }
    }
}
function insertEmailGiaTotResult(obj) {
    //edit 29/9/2011
    //edit
    if ($('txtEmailBottom') && $('aBtnEmail_Bottom')) {
        $("txtEmailBottom").value = "";
        $("txtEmailBottom").onkeypress = PressKey;
        $("aBtnEmail_Bottom").onclick = insertEmailNhanGiaTot;
    }
    /*if ($("txtEmailTopBanner")) {
    $("txtEmailTopBanner").value = "";
    $("txtEmailTopBanner").onkeypress = PressKey;
    }
    if ($("txtEmailSendNewDeal")) {
    $("txtEmailSendNewDeal").value = "";
    $("txtEmailSendNewDeal").onkeypress = PressKey;
    }
    if ($("btnInsertEmailGiaTot")) {
    $("btnInsertEmailGiaTot").onclick = insertEmailNhanGiaTot;
    }
    if ($("btnInsertEmailNewDeal")) {
    $("btnInsertEmailNewDeal").onclick = insertEmailNhanNewDeal;
    }
    if ($("txtEmailDKNhanGiaTot")) {
    $("txtEmailDKNhanGiaTot").value = "";
    }
    if ($("dvShahowDKNhanGiaTot")) {
    $("dvShahowDKNhanGiaTot").setStyle({ display: "none" });
    }
    if ($("dvPopupDKNhanGiaTot")) {
    $("dvPopupDKNhanGiaTot").addClassName("hide");
    }*/

    try {
        if (parseInt(obj) == 1) {
            showPopupErrorEmail_V4("Email đã cập nhật thành công");
            _gaq.push(['_trackEvent', 'MailLetter', 'Click', 'Get the best deals with discounts up to 90%']);
        } else {
            showPopupErrorEmail_V4("Email đã được đăng ký");
        }
    }
    catch (e) {
        //alert("Email của bạn đã cập nhật thành công")
    }

    //alert("-Cám ơn bạn đã nhập Email, nhómMua.com sẽ gửi mail cho bạn khi có Deal mới!, Bạn vui lòng bỏ email 'info@nhommua.com' vào address book để đảm bảo bạn sẽ nhận email từ nhomMua.com! Nếu không email có thể sẽ vào SPAM/BULK.");

    //end edit
}
/*****************************Ham show error*************************************/
function showPopupErrorEmail_V4(msg) {
    $('pErrorEmail').innerHTML = "<i></i>" +
                                 "<span>" + msg + "</span>";
    $j('#pErrorEmail').fadeIn();
    setTimeout("$j('#pErrorEmail').fadeOut();", 3000);
}
/*****************************Ham Change View Type***********************/
function changeViewMode(type) {
    SetCookie("viewMode", type, 30);
    window.location.reload();
}
/***************************Ham xu ly key press*/
function PressKey(e) {
    var evt = e ? e : window.event;
    var bt = $(this.id);
    if (bt) {
        if (evt.keyCode == "13" || evt.which == "13" || evt.charCode == "13") {
            try { bt.click(); } catch (e) { }
            switch (this.id) {
                case "txtEmailBottom":
                    insertEmailNhanGiaTot();
                    break;
                case "txtSearch":
                    searchDealRecent();
                    break;
                case "txtMaOrder":
                    clickViewOrder();
                    break;

                case "txtSIEmail": case "txtSIPass":
                    checkLoginSI();
                    break;
                //end edit      

                //Nhận giá tốt (nhận deal mỗi ngày)       
                //edit 24/9/2011      
                //case "txtEmailTopBanner":  
                //    insertEmailNhanGiaTot(); //insertEmailGiaTot();  
                //    break;  
                //                /*28.06 - New Popup Giá Tốt*/  
                //                case "txtEmailTopBanner": 
                //                    if ($('txtEmail_Bottom')) { 
                //                        $('txtEmail_Bottom').value = ""; 
                //                    } 
                //                    insertEmailNhanGiaTot(); 
                //                    break; 
                //                case "txtEmail_Bottom": 
                //                    if ($('txtEmailTopBanner')) { 
                //                        $('txtEmailTopBanner').value = ""; 
                //                    } 
                //                    insertEmailNhanGiaTot(); 
                //                    break; 
                //                /*End 28.06 - New Popup Giá Tốt*/  
                case "txtEmailSendNewDeal":
                    insertEmailNhanNewDeal();
                    break;
                //end edit       

                case "txtProService": case "txtPercent":
                    insertDeNghi();
                    break;
                case "txtResetRPass": case "txtResetPass":
                    resetPass();
                    break;
                case "txtEmail": case "txtPass":
                    checkLogin();
                    break;
                case "txtPEMail": case "txtPPass":
                    checkLoginPopUp();
                    break;

                //đăng ký nhanh      
                //edit 29/9/2011      
                case "txtSUBName": case "txtSUBEmail": case "txtSUBPass": case "txtSUBRePass":
                    SignUpBuy();
                    break;
                //end edit       

                //đăng ký      
                //edit 29/9/2011      
                case "txtSUName": case "txtSUNick": case "txtSUEmail": case "txtSUPass": case "txtSURePass":
                    SignUp(); //đăng ký
                    break;
                case "ddlDate": case "ddlMonth": case "ddlYear":
                    if ($("txtSUName") && $("txtSUNick") && $("txtSUEmail") &&
                        $("txtSUPass") && $("txtSURePass") && $("cbMale") && $("cbFemale") &&
                        $("ddlDate") && $("ddlMonth") && $("ddlYear")) {
                        SignUp(); //đăng ký
                    }
                    break;
                case "txtCapcha":
                    if ($("txtSUName") && $("txtSUNick") && $("txtSUEmail") &&
                        $("txtSUPass") && $("txtSURePass") && $("cbMale") && $("cbFemale")) {
                        SignUp(); //đăng ký
                    }
                    else if ($("txtForgotPass")) {
                        sendLostPass(); //reset mật khẩu
                    }
                    break;

                //reset mật khẩu      
                //edit      
                case "txtForgotPass":
                    sendLostPass(); //reset mật khẩu
                    break;
                //end edit 
                case "txtBKEmail": case "txtBKPass":
                    loginBooking();
                    break;
                case "txtBKName_Reg": case "txtBKEmail_Reg": case "txtBKPass_Reg": case "txtBKRePass_Reg":
                    quickRegBooking();
                    break;
                case "txtCheckBooking":
                    checkMaVoucherBooking();
                    break;
                case "txtBookingName": case "ddlChildren_1": case "ddlChildren_2": case "ddlChildren_3":
                case "ddlSoPhong": case "ddlSoNguoi": case "txtBookingName":
                    submitBookingInit();
                    break;
                case "txtBookingPhone":
                    submitBookingFinal();
                    break;
            }
            return false;
        }
    }
}
/***********************Ham Slide top 3 deal***********************/
var topSlide_Index = 0;
var timeout_slide;
function startTopDealSlide() {
    clearTimeout(timeout_slide);
    $j('#dButtonSlide_Cont li').unbind();
    var maxIndex = $j('#slideFocusDeal div.gr-deal-focus').length;
    $j('#dButtonSlide_Cont li').eq(topSlide_Index).attr("class", "");
    topSlide_Index = topSlide_Index == maxIndex - 1 ? 0 : parseInt(topSlide_Index) + 1;
    $j('#dButtonSlide_Cont li').eq(topSlide_Index).attr("class", "activeSlide");
    var marginValue = "-" + ($j('#dSlideTop3Deal_Cont').width() * topSlide_Index) + "px";
    $j('#slideFocusDeal').animate({ marginLeft: marginValue }, 1000, function () {
        $j('#dButtonSlide_Cont li').click(selectTopSlide);
        timeout_slide = setTimeout("startTopDealSlide()", 5000);
    });
}
function selectTopSlide() {
    clearTimeout(timeout_slide);
    $j('#dButtonSlide_Cont li').unbind();
    var index = this.id.split('_')[1];
    $j('#dButtonSlide_Cont li').eq(topSlide_Index).attr("class", "");
    topSlide_Index = parseInt(index);
    $j('#dButtonSlide_Cont li').eq(topSlide_Index).attr("class", "activeSlide");
    var marginValue = "-" + ($j('#dSlideTop3Deal_Cont').width() * index) + "px";
    $j('#slideFocusDeal').animate({ marginLeft: marginValue }, 1000, function () {
        $j('#dButtonSlide_Cont li').click(selectTopSlide);
        timeout_slide = setTimeout("startTopDealSlide()", 5000);
    });
}
function setTopSlideMargin() {
    clearTimeout(timeout_slide);
    var marginValue = "-" + ($j('#dSlideTop3Deal_Cont').width() * topSlide_Index) + "px";
    $j('#slideFocusDeal').css({ "marginLeft": marginValue });
    timeout_slide = setTimeout("startTopDealSlide()", 5000);
}
/***************************Ham set banner quang cao khi resize*********************/
var isBannerSize = 0;
function setDivQuangCao() {
    /*var version = 0; // we assume a sane browser
    var isIE = false;
    var width = $j(window).width();
    if (navigator.appVersion.indexOf("MSIE") != -1) {
    isIE = true;
    version = parseFloat(navigator.appVersion.split("MSIE")[1]);
    }*/
    var bannerWidth = $j('#dBanner').width();
    switch (iCityID) {
        case 8:
            if (bannerWidth == 1180 && isBannerSize != 1) {
                $j("#dBanner").html("<iframe id='af1101e4' name='af1101e4' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=528&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1180' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=aed51a0e&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=528&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=aed51a0e' border='0' alt='' /></a></iframe>");
                if ($("dBanner_Middle")) {
                    $j("#dBanner_Middle").html("<iframe id='a64cb9f3' name='a64cb9f3' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=619&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1180' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a5320067&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=619&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a5320067' border='0' alt='' /></a></iframe>");
                }
                isBannerSize = 1;
            }
            else if (bannerWidth == 978 && isBannerSize != 2) {
                $j("#dBanner").html("<iframe id='a307989d' name='a307989d' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=530&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=ab78bfcf&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=530&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=ab78bfcf' border='0' alt='' /></a></iframe>");
                if ($("dBanner_Middle")) {
                    $j("#dBanner_Middle").html("<iframe id='a7e50d43' name='a7e50d43' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=621&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=aaef4b9e&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=621&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=aaef4b9e' border='0' alt='' /></a></iframe>");
                }
                isBannerSize = 2;
            }
            else if (bannerWidth == 728 && isBannerSize != 3) {
                $j("#dBanner").html("<iframe id='aac24128' name='aac24128' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=529&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='728' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=ae4403a6&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=529&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=ae4403a6' border='0' alt='' /></a></iframe>");
                if ($("dBanner_Middle")) {
                    $j("#dBanner_Middle").html("<iframe id='aab8282d' name='aab8282d' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=620&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='728' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a279ac12&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=620&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a279ac12' border='0' alt='' /></a></iframe>");
                }
                isBannerSize = 3;
            }
            break;
        case 4:
            if (bannerWidth == 1180 && isBannerSize != 1) {
                $j("#dBanner").html("<iframe id='ae7ffcbf' name='ae7ffcbf' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=587&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1180' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a1b65889&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=587&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a1b65889' border='0' alt='' /></a></iframe>");
                isBannerSize = 1;
            }
            else if (bannerWidth == 978 && isBannerSize != 2) {
                $j("#dBanner").html("<iframe id='a5949007' name='a5949007' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=588&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=ad16a8c4&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=588&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=ad16a8c4' border='0' alt='' /></a></iframe>");
                isBannerSize = 2;
            }
            else if (bannerWidth == 728 && isBannerSize != 3) {
                $j("#dBanner").html("<iframe id='ac9f0c06' name='ac9f0c06' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=589&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='728' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=afa5d9eb&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=589&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=afa5d9eb' border='0' alt='' /></a></iframe>");
                isBannerSize = 3;
            }
            break;
        case 31:
            if (bannerWidth == 1180 && isBannerSize != 1) {
                $j("#dBanner").html("<iframe id='a06a99b6' name='a06a99b6' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=590&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1180' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a0690e67&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=590&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a0690e67' border='0' alt='' /></a></iframe>");
                isBannerSize = 1;
            }
            else if (bannerWidth == 978 && isBannerSize != 2) {
                $j("#dBanner").html("<iframe id='a5ee1c6b' name='a5ee1c6b' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=591&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a8b2e115&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=591&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a8b2e115' border='0' alt='' /></a></iframe>");
                isBannerSize = 2;
            }
            else if (bannerWidth == 728 && isBannerSize != 3) {
                $j("#dBanner").html("<iframe id='a7e57570' name='a7e57570' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=592&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='728' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a704e314&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=592&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a704e314' border='0' alt='' /></a></iframe>");
                isBannerSize = 3;
            }
            break;
        case 710:
            if (bannerWidth == 1180 && isBannerSize != 1) {
                $j("#dBanner").html("<iframe id='a90d033f' name='a90d033f' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=584&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1180' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a15ab784&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=584&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a15ab784' border='0' alt='' /></a></iframe>");
                isBannerSize = 1;
            }
            else if (bannerWidth == 978 && isBannerSize != 2) {
                $j("#dBanner").html("<iframe id='aa7a57e4' name='aa7a57e4' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=585&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a0080ab3&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=585&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a0080ab3' border='0' alt='' /></a></iframe>");
                isBannerSize = 2;
            }
            else if (bannerWidth == 728 && isBannerSize != 3) {
                $j("#dBanner").html("<iframe id='a0fb6694' name='a0fb6694' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=586&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='728' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a661089f&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=586&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a661089f' border='0' alt='' /></a></iframe>");
                isBannerSize = 3;
            }
            break;
    }
    /*if ( (width >= 1346 || (isIE == true && version < 9)) && isBannerSize != 1) {
    $j("#dBanner").html("<iframe id='a96de355' name='a96de355' src='http://ads2.diadiem.com/www/delivery/afr.php?zoneid=127&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1180' height='90' allowtransparency='true'><a href='http://ads2.diadiem.com/www/delivery/ck.php?n=a7adeb42&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads2.diadiem.com/www/delivery/avw.php?zoneid=127&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a7adeb42' border='0' alt='' /></a></iframe>");
    isBannerSize = 1;
    }
    else if (width < 1346 && width >= 1106 && isBannerSize != 2) {
    $j("#dBanner").html("<iframe id='a2f0296b' name='a2f0296b' src='http://ads2.diadiem.com/www/delivery/afr.php?zoneid=128&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90' allowtransparency='true'><a href='http://ads2.diadiem.com/www/delivery/ck.php?n=a8bce806&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads2.diadiem.com/www/delivery/avw.php?zoneid=128&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a8bce806' border='0' alt='' /></a></iframe>");
    isBannerSize = 2;
    }
    else if (width < 1106 && isBannerSize != 3) {
    $j("#dBanner").html("<iframe id='ac8c8340' name='ac8c8340' src='http://ads2.diadiem.com/www/delivery/afr.php?zoneid=129&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='728' height='90'><a href='http://ads2.diadiem.com/www/delivery/ck.php?n=aa733173&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads2.diadiem.com/www/delivery/avw.php?zoneid=129&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=aa733173' border='0' alt='' /></a></iframe>");
    isBannerSize = 3;
    }*/
}
var isBannerSizeNew = 0;
function setDivQuangCao_CafeAmThuc() {
    var bannerWidth = $j('#dNewBanner_CafeAmThuc_Top').width();
    switch (iCityID) {
        case 8:
            if (bannerWidth == 1218 && isBannerSizeNew != 1) {
                $j("#dNewBanner_CafeAmThuc_Top").html("<iframe id='ac7eab01' name='ac7eab01' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=604&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1218' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a31a17df&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=604&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a31a17df' border='0' alt='' /></a></iframe>");
                if ($("dNewBanner_CafeAmThuc_Middle")) {
                    $j("#dNewBanner_CafeAmThuc_Middle").html("<iframe id='ac7eab01' name='ac7eab01' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=604&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1218' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a31a17df&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=604&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a31a17df' border='0' alt='' /></a></iframe>");
                }
                isBannerSizeNew = 1;
            }
            else if (bannerWidth == 978 && isBannerSizeNew != 2) {
                $j("#dNewBanner_CafeAmThuc_Top").html("<iframe id='a39a0339' name='a39a0339' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=606&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a0f33ac2&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=606&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a0f33ac2' border='0' alt='' /></a></iframe>");
                if ($("dNewBanner_CafeAmThuc_Middle")) {
                    $j("#dNewBanner_CafeAmThuc_Middle").html("<iframe id='a39a0339' name='a39a0339' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=606&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a0f33ac2&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=606&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a0f33ac2' border='0' alt='' /></a></iframe>");
                }
                isBannerSizeNew = 2;
            }
            else if (bannerWidth == 748 && isBannerSizeNew != 3) {
                $j("#dNewBanner_CafeAmThuc_Top").html("<iframe id='aa2fb3dc' name='aa2fb3dc' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=605&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='748' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=ae934837&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=605&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=ae934837' border='0' alt='' /></a></iframe>");
                if ($("dNewBanner_CafeAmThuc_Middle")) {
                    $j("#dNewBanner_CafeAmThuc_Middle").html("<iframe id='aa2fb3dc' name='aa2fb3dc' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=605&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='748' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=ae934837&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=605&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=ae934837' border='0' alt='' /></a></iframe>");
                }
                isBannerSizeNew = 3;
            }
            break;
        /*	case 4:
        if (bannerWidth == 1180 && isBannerSizeNew != 1) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='ae7ffcbf' name='ae7ffcbf' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=587&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1180' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a1b65889&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=587&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a1b65889' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 1;
        }
        else if (bannerWidth == 978 && isBannerSizeNew != 2) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a5949007' name='a5949007' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=588&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=ad16a8c4&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=588&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=ad16a8c4' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 2;
        }
        else if (bannerWidth == 728 && isBannerSizeNew != 3) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='ac9f0c06' name='ac9f0c06' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=589&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='728' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=afa5d9eb&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=589&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=afa5d9eb' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 3;
        }
        break;
        case 31:
        if (bannerWidth == 1180 && isBannerSizeNew != 1) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a06a99b6' name='a06a99b6' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=590&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1180' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a0690e67&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=590&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a0690e67' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 1;
        }
        else if (bannerWidth == 978 && isBannerSizeNew != 2) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a5ee1c6b' name='a5ee1c6b' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=591&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a8b2e115&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=591&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a8b2e115' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 2;
        }
        else if (bannerWidth == 728 && isBannerSizeNew != 3) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a7e57570' name='a7e57570' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=592&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='728' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a704e314&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=592&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a704e314' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 3;
        }
        break;
        case 710:
        if (bannerWidth == 1180 && isBannerSizeNew != 1) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a90d033f' name='a90d033f' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=584&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1180' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a15ab784&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=584&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a15ab784' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 1;
        }
        else if (bannerWidth == 978 && isBannerSizeNew != 2) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='aa7a57e4' name='aa7a57e4' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=585&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a0080ab3&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=585&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a0080ab3' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 2;
        }
        else if (bannerWidth == 728 && isBannerSizeNew != 3) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a0fb6694' name='a0fb6694' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=586&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='728' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a661089f&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=586&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a661089f' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 3;
        }
        break;*/ 
    }
}

function setDivQuangCao_DichVu() {
    var bannerWidth = $j('#dNewBanner_DichVu_Top').width();
    switch (iCityID) {
        case 8:
            if (bannerWidth == 1218 && isBannerSizeNew != 1) {
                $j("#dNewBanner_DichVu_Top").html("<iframe id='afe508f2' name='afe508f2' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=607&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1218' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a6f5bfab&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=607&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a6f5bfab' border='0' alt='' /></a></iframe>");
                if ($("dNewBanner_DichVu_Middle")) {
                    $j("#dNewBanner_DichVu_Middle").html("<iframe id='afe508f2' name='afe508f2' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=607&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1218' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a6f5bfab&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=607&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a6f5bfab' border='0' alt='' /></a></iframe>");
                }
                isBannerSizeNew = 1;
            }
            else if (bannerWidth == 978 && isBannerSizeNew != 2) {
                $j("#dNewBanner_DichVu_Top").html("<iframe id='adbf41d8' name='adbf41d8' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=609&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=ae929958&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=609&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=ae929958' border='0' alt='' /></a></iframe>");
                if ($("dNewBanner_DichVu_Middle")) {
                    $j("#dNewBanner_DichVu_Middle").html("<iframe id='adbf41d8' name='adbf41d8' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=609&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=ae929958&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=609&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=ae929958' border='0' alt='' /></a></iframe>");
                }
                isBannerSizeNew = 2;
            }
            else if (bannerWidth == 748 && isBannerSizeNew != 3) {
                $j("#dNewBanner_DichVu_Top").html("<iframe id='acdd5365' name='acdd5365' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=608&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='748' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=aec7d0db&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=608&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=aec7d0db' border='0' alt='' /></a></iframe>");
                if ($("dNewBanner_DichVu_Middle")) {
                    $j("#dNewBanner_DichVu_Middle").html("<iframe id='acdd5365' name='acdd5365' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=608&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='748' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=aec7d0db&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=608&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=aec7d0db' border='0' alt='' /></a></iframe>");
                }
                isBannerSizeNew = 3;
            }
            break;
        /*	case 4:
        if (bannerWidth == 1180 && isBannerSizeNew != 1) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='ae7ffcbf' name='ae7ffcbf' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=587&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1180' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a1b65889&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=587&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a1b65889' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 1;
        }
        else if (bannerWidth == 978 && isBannerSizeNew != 2) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a5949007' name='a5949007' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=588&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=ad16a8c4&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=588&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=ad16a8c4' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 2;
        }
        else if (bannerWidth == 728 && isBannerSizeNew != 3) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='ac9f0c06' name='ac9f0c06' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=589&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='728' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=afa5d9eb&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=589&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=afa5d9eb' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 3;
        }
        break;
        case 31:
        if (bannerWidth == 1180 && isBannerSizeNew != 1) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a06a99b6' name='a06a99b6' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=590&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1180' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a0690e67&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=590&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a0690e67' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 1;
        }
        else if (bannerWidth == 978 && isBannerSizeNew != 2) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a5ee1c6b' name='a5ee1c6b' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=591&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a8b2e115&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=591&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a8b2e115' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 2;
        }
        else if (bannerWidth == 728 && isBannerSizeNew != 3) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a7e57570' name='a7e57570' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=592&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='728' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a704e314&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=592&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a704e314' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 3;
        }
        break;
        case 710:
        if (bannerWidth == 1180 && isBannerSizeNew != 1) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a90d033f' name='a90d033f' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=584&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1180' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a15ab784&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=584&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a15ab784' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 1;
        }
        else if (bannerWidth == 978 && isBannerSizeNew != 2) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='aa7a57e4' name='aa7a57e4' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=585&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a0080ab3&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=585&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a0080ab3' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 2;
        }
        else if (bannerWidth == 728 && isBannerSizeNew != 3) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a0fb6694' name='a0fb6694' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=586&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='728' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a661089f&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=586&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a661089f' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 3;
        }
        break;*/ 
    }
}


function setDivQuangCao_HotelTour() {
    var bannerWidth = $j('#dNewBanner_HotelTour_Top').width();
    switch (iCityID) {
        case 8:
            if (bannerWidth == 1218 && isBannerSizeNew != 1) {
                $j("#dNewBanner_HotelTour_Top").html("<iframe id='ac95b2a6' name='ac95b2a6' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=610&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1218' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a2fa916b&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=610&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a2fa916b' border='0' alt='' /></a></iframe>");
                if ($("dNewBanner_HotelTour_Middle")) {
                    $j("#dNewBanner_HotelTour_Middle").html("<iframe id='ac95b2a6' name='ac95b2a6' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=610&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1218' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a2fa916b&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=610&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a2fa916b' border='0' alt='' /></a></iframe>");
                }
                isBannerSizeNew = 1;
            }
            else if (bannerWidth == 978 && isBannerSizeNew != 2) {
                $j("#dNewBanner_HotelTour_Top").html("<iframe id='add0b634' name='add0b634' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=612&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=aa630c15&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=612&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=aa630c15' border='0' alt='' /></a></iframe>");
                if ($("dNewBanner_HotelTour_Middle")) {
                    $j("#dNewBanner_HotelTour_Middle").html("<iframe id='add0b634' name='add0b634' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=612&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=aa630c15&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=612&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=aa630c15' border='0' alt='' /></a></iframe>");
                }
                isBannerSizeNew = 2;
            }
            else if (bannerWidth == 748 && isBannerSizeNew != 3) {
                $j("#dNewBanner_HotelTour_Top").html("<iframe id='a296f410' name='a296f410' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=611&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='748' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=aeca71e3&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=611&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=aeca71e3' border='0' alt='' /></a></iframe>");
                if ($("dNewBanner_HotelTour_Middle")) {
                    $j("#dNewBanner_HotelTour_Middle").html("<iframe id='a296f410' name='a296f410' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=611&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='748' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=aeca71e3&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=611&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=aeca71e3' border='0' alt='' /></a></iframe>");
                }
                isBannerSizeNew = 3;
            }
            break;
        /*	case 4:
        if (bannerWidth == 1180 && isBannerSizeNew != 1) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='ae7ffcbf' name='ae7ffcbf' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=587&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1180' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a1b65889&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=587&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a1b65889' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 1;
        }
        else if (bannerWidth == 978 && isBannerSizeNew != 2) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a5949007' name='a5949007' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=588&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=ad16a8c4&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=588&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=ad16a8c4' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 2;
        }
        else if (bannerWidth == 728 && isBannerSizeNew != 3) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='ac9f0c06' name='ac9f0c06' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=589&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='728' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=afa5d9eb&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=589&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=afa5d9eb' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 3;
        }
        break;
        case 31:
        if (bannerWidth == 1180 && isBannerSizeNew != 1) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a06a99b6' name='a06a99b6' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=590&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1180' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a0690e67&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=590&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a0690e67' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 1;
        }
        else if (bannerWidth == 978 && isBannerSizeNew != 2) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a5ee1c6b' name='a5ee1c6b' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=591&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a8b2e115&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=591&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a8b2e115' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 2;
        }
        else if (bannerWidth == 728 && isBannerSizeNew != 3) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a7e57570' name='a7e57570' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=592&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='728' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a704e314&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=592&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a704e314' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 3;
        }
        break;
        case 710:
        if (bannerWidth == 1180 && isBannerSizeNew != 1) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a90d033f' name='a90d033f' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=584&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1180' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a15ab784&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=584&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a15ab784' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 1;
        }
        else if (bannerWidth == 978 && isBannerSizeNew != 2) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='aa7a57e4' name='aa7a57e4' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=585&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a0080ab3&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=585&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a0080ab3' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 2;
        }
        else if (bannerWidth == 728 && isBannerSizeNew != 3) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a0fb6694' name='a0fb6694' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=586&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='728' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a661089f&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=586&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a661089f' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 3;
        }
        break;*/ 
    }
}


function setDivQuangCao_SanPham() {
    var bannerWidth = $j('#dNewBanner_SanPham_Top').width();
    switch (iCityID) {
        case 8:
            if (bannerWidth == 1218 && isBannerSizeNew != 1) {
                $j("#dNewBanner_SanPham_Top").html("<iframe id='a90a4c6f' name='a90a4c6f' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=613&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1218' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a1845cf5&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=613&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a1845cf5' border='0' alt='' /></a></iframe>");
                if ($("dNewBanner_SanPham_Middle")) {
                    $j("#dNewBanner_SanPham_Middle").html("<iframe id='a90a4c6f' name='a90a4c6f' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=613&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1218' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a1845cf5&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=613&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a1845cf5' border='0' alt='' /></a></iframe>");
                }
                isBannerSizeNew = 1;
            }
            else if (bannerWidth == 978 && isBannerSizeNew != 2) {
                $j("#dNewBanner_SanPham_Top").html("<iframe id='a58962ce' name='a58962ce' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=615&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a0fa1608&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=615&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a0fa1608' border='0' alt='' /></a></iframe>");
                if ($("dNewBanner_SanPham_Middle")) {
                    $j("#dNewBanner_SanPham_Middle").html("<iframe id='a58962ce' name='a58962ce' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=615&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a0fa1608&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=615&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a0fa1608' border='0' alt='' /></a></iframe>");
                }
                isBannerSizeNew = 2;
            }
            else if (bannerWidth == 748 && isBannerSizeNew != 3) {
                $j("#dNewBanner_SanPham_Top").html("<iframe id='a0403270' name='a0403270' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=614&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='748' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a575dcd2&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=614&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a575dcd2' border='0' alt='' /></a></iframe>");
                if ($("dNewBanner_SanPham_Middle")) {
                    $j("#dNewBanner_SanPham_Middle").html("<iframe id='a0403270' name='a0403270' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=614&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='748' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a575dcd2&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=614&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a575dcd2' border='0' alt='' /></a></iframe>");
                }
                isBannerSizeNew = 3;
            }
            break;
        /*	case 4:
        if (bannerWidth == 1180 && isBannerSizeNew != 1) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='ae7ffcbf' name='ae7ffcbf' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=587&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1180' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a1b65889&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=587&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a1b65889' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 1;
        }
        else if (bannerWidth == 978 && isBannerSizeNew != 2) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a5949007' name='a5949007' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=588&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=ad16a8c4&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=588&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=ad16a8c4' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 2;
        }
        else if (bannerWidth == 728 && isBannerSizeNew != 3) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='ac9f0c06' name='ac9f0c06' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=589&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='728' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=afa5d9eb&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=589&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=afa5d9eb' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 3;
        }
        break;
        case 31:
        if (bannerWidth == 1180 && isBannerSizeNew != 1) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a06a99b6' name='a06a99b6' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=590&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1180' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a0690e67&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=590&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a0690e67' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 1;
        }
        else if (bannerWidth == 978 && isBannerSizeNew != 2) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a5ee1c6b' name='a5ee1c6b' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=591&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a8b2e115&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=591&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a8b2e115' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 2;
        }
        else if (bannerWidth == 728 && isBannerSizeNew != 3) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a7e57570' name='a7e57570' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=592&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='728' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a704e314&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=592&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a704e314' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 3;
        }
        break;
        case 710:
        if (bannerWidth == 1180 && isBannerSizeNew != 1) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a90d033f' name='a90d033f' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=584&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1180' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a15ab784&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=584&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a15ab784' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 1;
        }
        else if (bannerWidth == 978 && isBannerSizeNew != 2) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='aa7a57e4' name='aa7a57e4' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=585&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a0080ab3&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=585&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a0080ab3' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 2;
        }
        else if (bannerWidth == 728 && isBannerSizeNew != 3) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a0fb6694' name='a0fb6694' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=586&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='728' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a661089f&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=586&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a661089f' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 3;
        }
        break;*/ 
    }
}

function setDivQuangCao_SpaLamDep() {
    var bannerWidth = $j('#dNewBanner_SpaLamDep_Top').width();
    switch (iCityID) {
        case 8:
            if (bannerWidth == 1218 && isBannerSizeNew != 1) {
                $j("#dNewBanner_SpaLamDep_Top").html("<iframe id='ac5038e8' name='ac5038e8' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=616&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1218' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a81f5dd9&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=616&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a81f5dd9' border='0' alt='' /></a></iframe>");
                if ($("dNewBanner_SpaLamDep_Middle")) {
                    $j("#dNewBanner_SpaLamDep_Middle").html("<iframe id='ac5038e8' name='ac5038e8' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=616&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1218' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a81f5dd9&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=616&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a81f5dd9' border='0' alt='' /></a></iframe>");
                }
                isBannerSizeNew = 1;
            }
            else if (bannerWidth == 978 && isBannerSizeNew != 2) {
                $j("#dNewBanner_SpaLamDep_Top").html("<iframe id='a93f8667' name='a93f8667' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=618&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=adaaa64d&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=618&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=adaaa64d' border='0' alt='' /></a></iframe>");
                if ($("dNewBanner_SpaLamDep_Middle")) {
                    $j("#dNewBanner_SpaLamDep_Middle").html("<iframe id='a93f8667' name='a93f8667' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=618&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=adaaa64d&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=618&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=adaaa64d' border='0' alt='' /></a></iframe>");
                }
                isBannerSizeNew = 2;
            }
            else if (bannerWidth == 748 && isBannerSizeNew != 3) {
                $j("#dNewBanner_SpaLamDep_Top").html("<iframe id='afc59c12' name='afc59c12' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=617&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='748' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a67eb677&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=617&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a67eb677' border='0' alt='' /></a></iframe>");
                if ($("dNewBanner_SpaLamDep_Middle")) {
                    $j("#dNewBanner_SpaLamDep_Middle").html("<iframe id='afc59c12' name='afc59c12' src='http://ads.mjgroup.vn/www/delivery/afr.php?refresh=15&amp;zoneid=617&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='748' height='90'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a67eb677&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=617&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a67eb677' border='0' alt='' /></a></iframe>");
                }
                isBannerSizeNew = 3;
            }
            break;
        /*	case 4:
        if (bannerWidth == 1180 && isBannerSizeNew != 1) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='ae7ffcbf' name='ae7ffcbf' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=587&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1180' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a1b65889&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=587&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a1b65889' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 1;
        }
        else if (bannerWidth == 978 && isBannerSizeNew != 2) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a5949007' name='a5949007' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=588&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=ad16a8c4&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=588&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=ad16a8c4' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 2;
        }
        else if (bannerWidth == 728 && isBannerSizeNew != 3) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='ac9f0c06' name='ac9f0c06' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=589&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='728' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=afa5d9eb&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=589&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=afa5d9eb' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 3;
        }
        break;
        case 31:
        if (bannerWidth == 1180 && isBannerSizeNew != 1) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a06a99b6' name='a06a99b6' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=590&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1180' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a0690e67&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=590&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a0690e67' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 1;
        }
        else if (bannerWidth == 978 && isBannerSizeNew != 2) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a5ee1c6b' name='a5ee1c6b' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=591&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a8b2e115&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=591&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a8b2e115' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 2;
        }
        else if (bannerWidth == 728 && isBannerSizeNew != 3) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a7e57570' name='a7e57570' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=592&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='728' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a704e314&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=592&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a704e314' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 3;
        }
        break;
        case 710:
        if (bannerWidth == 1180 && isBannerSizeNew != 1) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a90d033f' name='a90d033f' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=584&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='1180' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a15ab784&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=584&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a15ab784' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 1;
        }
        else if (bannerWidth == 978 && isBannerSizeNew != 2) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='aa7a57e4' name='aa7a57e4' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=585&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='978' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a0080ab3&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=585&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a0080ab3' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 2;
        }
        else if (bannerWidth == 728 && isBannerSizeNew != 3) {
        $j("#dNewBanner_CafeAmThuc_top").html("<iframe id='a0fb6694' name='a0fb6694' src='http://ads.mjgroup.vn/www/delivery/afr.php?zoneid=586&amp;cb=INSERT_RANDOM_NUMBER_HERE' frameborder='0' scrolling='no' width='728' height='90' allowtransparency='true'><a href='http://ads.mjgroup.vn/www/delivery/ck.php?n=a661089f&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.mjgroup.vn/www/delivery/avw.php?zoneid=586&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a661089f' border='0' alt='' /></a></iframe>");
        isBannerSizeNew = 3;
        }
        break;*/ 
    }
}




/***************************Ham scroll menu top deal*******************************/
function scrollMenu() {
    /*var offsetY = typeof (window.pageYOffset) == 'number' ? window.pageYOffset : document.documentElement.scrollTop;
    if (offsetY > 120) {
    $j(".sectionEmail").addClass("scrollMenu");
    } else if (offsetY <= 120) { $j(".sectionEmail").removeClass("scrollMenu"); }
    */
    var offsetY = typeof (window.pageYOffset) == 'number' ? window.pageYOffset : document.documentElement.scrollTop;
    if (offsetY > 120) {
        $j(".sectionEmail").addClass("scrollMenu");
        //02/10 set vi tri popup addcart theo size window
        if ($j(".newSP-cart")) {
            $j(".newSP-cart").addClass("moveCart");
            var position = $j(".mod-innerHeader").offset();
            $j(".newSP-cart").css({
                right: position.left + 'px'
            })
        }
        //end 02/10 set vi tri popup addcart theo size window
    } else if (offsetY <= 120) {
        $j(".sectionEmail").removeClass("scrollMenu");
        //02/10 set vi tri popup addcart theo size window
        if ($j(".newSP-cart")) {
            $j(".newSP-cart").removeClass("moveCart");
            $j(".newSP-cart").css({
                right: "1px"
            })
        }
        //end 02/10 set vi tri popup addcart theo size window
    }
}
/**************************Ham an loader hinh***********************************/
function hideImgLoader_V4() {
    if ($j('a.imgLV').length > 0) {
        for (var i = 0; i < $j('a.imgLV').length; i++) {
            $j('a.imgLV').eq(i).css("background", "none");
        }
    }
    if ($j('a.aImgDeal h1').length > 0) {
        for (var i = 0; i < $j('a.aImgDeal h1').length; i++) {
            $j('a.aImgDeal h1').eq(i).css("background", "none");
        }
    }
    if ($j('a.imgTravel h1').length > 0) {
        for (var i = 0; i < $j('a.imgTravel h1').length; i++) {
            $j('a.imgTravel h1').eq(i).css("background", "none");
        }
    }
}
/*************************Ham set popup center*********************/
function setPopUpCenter(idPopup) {
    var BrowserWidth;
    var BrowserHeight;
    if (typeof window.innerWidth != 'undefined') {// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
        BrowserWidth = window.innerWidth,
        BrowserHeight = window.innerHeight
    }
    // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
    else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) {
        BrowserWidth = document.documentElement.clientWidth,
        BrowserHeight = document.documentElement.clientHeight
    }
    else {// older versions of IE
        BrowserWidth = document.getElementsByTagName('body')[0].clientWidth,
        BrowserHeight = document.getElementsByTagName('body')[0].clientHeight
    }
    var arrScroll = getScrollXY();
    var divHeight = $(idPopup).getHeight();
    var divWidth = $(idPopup).getWidth();
    var top = BrowserHeight > divHeight ? (((BrowserHeight - divHeight) / 2) + arrScroll[1]) : 0;
    var left = BrowserWidth > divWidth ? (((BrowserWidth - divWidth) / 2) + arrScroll[0]) : 0;
    var mes = "scroll Left: " + arrScroll[0] + "\n" + "scroll Top : " + arrScroll[1] + "\n Left : " + left + "\n Top : " + top;
    $(idPopup).setStyle({ "top": top + "px", "position": "absolute", "left": (left - 9) + "px" });
    //window.scrollTo(0, 0);

}
function getScrollXY() {
    var scrOfX = 0, scrOfY = 0;
    if (typeof (window.pageYOffset) == 'number') {
        //Netscape compliant
        scrOfY = window.pageYOffset;
        scrOfX = window.pageXOffset;
    } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {
        //DOM compliant
        scrOfY = document.body.scrollTop;
        scrOfX = document.body.scrollLeft;
    } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
        scrOfX = document.documentElement.scrollLeft;
    }
    return [scrOfX, scrOfY];
}
/***********************Ham xu ly canh deu text title*************************/
function reArrangeTitle_V4() {
    if ($j('#dListDeal div.oneline-offer').length > 0) {
        var listEle = $j('#dListDeal div.oneline-offer');
        for (var i = 0; i < listEle.length; i++) {
            listEle.eq(i).removeClass('oneline-offer');
        }
    }
    if ($j('#dListDeal div.moreline-offer').length > 0) {
        var listEle = $j('#dListDeal div.moreline-offer');
        for (var i = 0; i < listEle.length; i++) {
            listEle.eq(i).removeClass('moreline-offer');
        }
    }
    if ($j('#dListDeal div.info-offer h1').length > 0) {
        var listEleAfter = $j('#dListDeal div.info-offer h1');
        for (var i = 0; i < listEleAfter.length; i++) {
            if (listEleAfter.eq(i).height() > 20) {
                listEleAfter.eq(i).css({ "padding": "4px 10px", "height": "34px", "overflow": "hidden" });
            }
            else {
                listEleAfter.eq(i).css("padding", "10px");
            }
        }
    }
    if ($j('#dTop2Deal div.info-offer h1').length > 0) {
        var listEleAfter = $j('#dTop2Deal div.info-offer h1');
        for (var i = 0; i < listEleAfter.length; i++) {
            if (listEleAfter.eq(i).height() > 20) {
                listEleAfter.eq(i).css({ "padding": "4px 10px", "height": "34px", "overflow": "hidden" });
            }
            else {
                listEleAfter.eq(i).css("padding", "10px");
            }
        }
    }
    if ($j('#divRecentDeal div.info-offer h1').length > 0) {
        var listEleAfter = $j('#divRecentDeal div.info-offer h1');
        for (var i = 0; i < listEleAfter.length; i++) {
            listEleAfter.eq(i).removeAttr("style");
            listEleAfter.eq(i).css({ "padding": "0px 10px 0px 10px" });
            //console.log(listEleAfter.eq(i).height());
            if (listEleAfter.eq(i).height() > 20) {
                listEleAfter.eq(i).css({ "padding": "4px 10px", "height": "34px", "overflow": "hidden" });
            }
            else {
                listEleAfter.eq(i).css("padding", "10px");
            }
        }
    }
    if ($j('#dSameDeal div.info-offer h1').length > 0) {
        var listEleAfter = $j('#dSameDeal div.info-offer h1');
        for (var i = 0; i < listEleAfter.length; i++) {
            listEleAfter.eq(i).removeAttr("style");
            listEleAfter.eq(i).css({ "padding": "0px 10px 0px 10px" });
            //console.log(listEleAfter.eq(i).height());
            if (listEleAfter.eq(i).height() > 20) {
                listEleAfter.eq(i).css({ "padding": "4px 10px", "height": "34px", "overflow": "hidden" });
            }
            else {
                listEleAfter.eq(i).css("padding", "10px");
            }
        }
    }
}
function reArrangeTitle_V4_SideDeal() {
    if ($j('#ulListSideDeal div.info-offer').length > 0) {
        var listEle = $j('#ulListSideDeal div.info-offer h1');
        for (var i = 0; i < listEle.length; i++) {
            listEle.eq(i).removeAttr("style");
            listEle.eq(i).css({ "padding": "0px 10px 0px 10px" });
            if (listEle.eq(i).height() > 20) {
                listEle.eq(i).css({ "padding": "8px 10px 0px 10px", "height": "34px", "overflow": "hidden" });
            }
            else {
                listEle.eq(i).css("padding", "17px 10px 0px 10px");
            }
        }
    }
}
/*************************Ham xu ly load data bang ajax**********************************/

var iId = "";
var timeMoney = null;
var timeFast = null;
var timeNumber = null;
var timeNew = null;
var strFast = "";
var strMoney = "";
var strNumber = "";
var strNew = "";
var strViewType = document.getElementById("aViewMode_Grid") ? "grid" : "list";
function loadProduct(e) {
    try {
        if (window.event) {

            if (!event.shiftKey && !event.ctrlKey && !event.altKey) {
                window.event.returnValue = null;
                event.keyCode = 0;
            }
        }
        else {

            e.preventDefault();
        }

    } catch (ex) { }

    var strUrlLocation = window.location.href;
    strUrlLocation = strUrlLocation.replace('tp-ho-chi-minh/', '').replace('ha-noi/', '');
    var strUrlLink = strPathLink_All.replace('tp-ho-chi-minh/', '').replace('ha-noi/', '');
    if (strUrlLocation.toLowerCase().indexOf("/yahoo/") != -1) {
        strUrlLink = strPathLink_All + "yahoo/";
    }
    iView = $(this).name;
    iId = $(this).id;
    Loading();
    if (iId == "fast") {
        if (timeFast == null) {
            new Ajax.Request(strUrlLink + strStateNM + '/mua-hang-gia-re.html?flag=loadProduct&view=' + iView,
            //new Ajax.Request("Index_new.aspx?flag=loadProduct&view=" + iView,
                {
                method: 'POST',
                onSuccess: ShowProduct
                    ,
                onFailure: function () { }
            });


        } else {
            //document.getElementById("money").className = "hotPrice";
            document.getElementById("number").className = "hotPrice";
            document.getElementById("fast").className = "hotTime active";
            document.getElementById("new").className = "dealToday";
            $("dListDeal").innerHTML = strFast;
        }
    }
    //    else if (iId == "money") {
    //        if (timeMoney == null) {
    //            new Ajax.Request(strUrlLink + strStateNM + '/mua-hang-gia-re.html?flag=loadProduct&view=' + iView ,
    //            //new Ajax.Request("Index_new.aspx?flag=loadProduct&view=" + iView,
    //                    {
    //                        method: 'POST',
    //                        onSuccess: ShowProduct
    //                        ,
    //                        onFailure: function() { }
    //                    });

    //        } else {
    //            $("dListDeal").innerHTML = strMoney;
    //            document.getElementById("money").className = "hotPrice active";
    //            document.getElementById("number").className = "hotCompa";
    //            document.getElementById("fast").className = "hotTime";
    //            document.getElementById("new").className = "dealToday";
    //        }
    //    } 
    else if (iId == "number") {
        if (timeNumber == null) {
            new Ajax.Request(strUrlLink + strStateNM + '/mua-hang-gia-re.html?flag=loadProduct&view=' + iView,
            //new Ajax.Request("Index_new.aspx?flag=loadProduct&view=" + iView,
                    {
                    method: 'POST',
                    onSuccess: ShowProduct
                        ,
                    onFailure: function () { }
                });
        } else {
            $("dListDeal").innerHTML = strNumber;
            //document.getElementById("money").className = "hotPrice";
            document.getElementById("number").className = "hotPrice active";
            document.getElementById("fast").className = "hotTime";
            document.getElementById("new").className = "dealToday";
        }
    }
    else if (iId == "new") {
        if (timeNew == null) {
            new Ajax.Request(strUrlLink + strStateNM + '/mua-hang-gia-re.html?flag=loadProduct&view=' + iView,
            //new Ajax.Request("Index_new.aspx?flag=loadProduct&view=" + iView,
                    {
                    method: 'POST',
                    onSuccess: ShowProduct
                        ,
                    onFailure: function () { }
                });

        } else {
            $("dListDeal").innerHTML = strNew;
            document.getElementById("new").className = "dealToday active";
            //document.getElementById("money").className = "hotPrice";
            document.getElementById("number").className = "hotPrice";
            document.getElementById("fast").className = "hotTime";
        }
    }
}
function ShowProduct(obj) {

    var strReturn = "";
    $("dListDeal").innerHTML = obj.responseText;
    //document.getElementById("money").className = "hotPrice";
    document.getElementById("number").className = "hotPrice";
    document.getElementById("fast").className = "hotTime";
    document.getElementById("new").className = "dealToday";
    if (iId == "fast") {
        document.getElementById(iId).className = "hotTime active";
        timeFast = 1;
        setTimeout("timeFast = null;", 10000);
        strFast = obj.responseText;
    }
    //    else if (iId == "money") {
    //        document.getElementById(iId).className = "hotPrice active";
    //        timeMoney = 1;
    //        setTimeout("timeMoney = null;", 10000);
    //        strMoney = obj.responseText;
    //    } 
    else if (iId == "number") {
        document.getElementById(iId).className = "hotPrice active";
        timeNumber = 1;
        setTimeout("timeNumber = null;", 10000);
        strNumber = obj.responseText;
    }
    else {
        document.getElementById(iId).className = "dealToday active";
        timeNew = 1;
        setTimeout("timeNew = null;", 10000);
        strNew = obj.responseText;
    }
    reArrangeTitle_V4();
    setTimeout("hideImgLoader_V4()", 3000);
}
function Loading() {
    var strReturn = "";
    strReturn += "<div id='divLoading' style='width:100%;'><img src='http://www.mjgroup.com.vn/tp-ho-chi-minh/images_v4/loader.gif' alt='loading' style='margin: auto;padding: 50px 0px;'/></div>";
    $("dListDeal").innerHTML = strReturn;
}
/*****************************Ham xy ly load more deal trang chu*****************************/
function loadProductMore() {
    var strUrlLocation = window.location.href;
    strUrlLocation = strUrlLocation.replace('tp-ho-chi-minh/', '').replace('ha-noi/', '');
    var strUrlLink = strPathLink_All.replace('tp-ho-chi-minh/', '').replace('ha-noi/', '');
    if (strUrlLocation.toLowerCase().indexOf("/yahoo/") != -1) {
        strUrlLink = strPathLink_All + "yahoo/";
    }
    LoadingMore();
    var tag = $('aViewMore_Product');
    tag.parentNode.removeChild(tag);
    viewType = tag.name.split("_")[0];
    iLoadNum = tag.name.split("_")[1];
    viewMode = tag.name.split("_")[2];
    //new Ajax.Request('http://localhost:50606/NhomMuaV4/Index_new.aspx?st=tp-ho-chi-minh&flag=loadProductMore&view=' + viewType + "&loadNum=" + iLoadNum + "&viewMode=" + viewMode,
    new Ajax.Request(strUrlLink + strStateNM + '/mua-hang-gia-re.html?flag=loadProductMore&view=' + viewType + "&loadNum=" + iLoadNum + "&viewMode=" + viewMode,
                {
                    method: 'POST',
                    onSuccess: ShowProductMore,
                    onFailure: function () { }
                });
}
function ShowProductMore(obj) {
    var strReturn = "";
    $("divLoading").parentNode.removeChild($("divLoading"));
    $("dListDeal").innerHTML += obj.responseText;
    hideImgLoader_V4();
}
function LoadingMore() {
    var strReturn = "";
    strReturn += "<div id='divLoading' style=' text-align:center;display:none;width:100%;'><img src='http://www.mjgroup.com.vn/tp-ho-chi-minh/images_v4/loader.gif' alt='loading' style='margin:15px auto;'/></div>";
    $("dListDeal").innerHTML += strReturn;
    $("divLoading").style.display = "block";
}
/*****************************Ham scroll trang to top***************************************/
function scrollToTop() {
    $('dvBackToTop').onclick = "";
    $j('body,html').stop(true, true).animate({ scrollTop: 0 }, 800, function () {
        $('dvBackToTop').onclick = scrollToTop;
    });
}
/*****************************Ham xu ly scroll popup share**********************************/
function scrollShareSocial() {
    if ($('dShare_Social')) {
        var shareTopPos = 0;
        if ($j(window).scrollTop() == 0) {
            shareTopPos = $j('#dTopSubMenu').offset().top + $j('#dTopSubMenu').height() + 30;
        }
        else if ($j('#dTopSubMenu').css("top") == "auto") {
            shareTopPos = $j('#dTopSubMenu').offset().top - $j(window).scrollTop() + $j('#dTopSubMenu').height() + 30;
        }
        else {
            shareTopPos = $j('#dTopSubMenu').height() + 30;
        }
        $j('#dShare_Social').css({ "top": shareTopPos + "px" });
    }
}
/***********************Ham xu ly hien popup error***********************************/
function showErrorRegister(type, msg) {
    window.scrollTo(0, 0);
    $j('#pError').css({ "display": "none" });
    var errorClass = type == "error" ? "" : "class='success'";
    $('pError').innerHTML = "<p " + errorClass + "><span class='pop-up-img'></span><span>" + msg + "</span></p>";
    $j('#pError').stop(true, true).slideDown(500, function () {
        window.clearTimeout();
        setTimeout(function () { $j('#pError').stop(true, true).slideUp(500); }, 2000);
    });
}
function getQueryStringValue(value) {

    var listQuery = new Array();
    var query_value = "";
    listQuery = window.location.search.substring(1).split('&');
    for (var i = 0; i < listQuery.length; i++) {
        if (listQuery[i].indexOf(value) != -1) {
            query_value = listQuery[i].split('=')[1];
        }
    }

    return query_value;

}
/********************Ham xy ly hien popup like gio hang***************/
function showPopupLikeCart() {
    $j('#dShadow').fadeIn(500, function () {
        setPopUpCenter('dPopupLikeCart');
        $j('#dPopupLikeCart').slideDown(750);
    });
}
function submitLikeCart() {
    var isLike = this.name;
    var strUrlLocation = window.location.href;
    strUrlLocation = strUrlLocation.replace('tp-ho-chi-minh/', '').replace('ha-noi/', '');
    var strUrlLink = strPathLink_All.replace('tp-ho-chi-minh/', '').replace('ha-noi/', '');
    if (strUrlLocation.toLowerCase().indexOf("/yahoo/") != -1) {
        strUrlLink = strPathLink_All + "yahoo/";
    }
    utils.call(strUrlLink + strStateNM + "/mua-hang-gia-re.html", { "flag": "submitLike", "isLike": isLike }, "POST", "submitLikeCartResult", "submitLikeCartResult");
    //utils.call("http://localhost:50606/NhomMuaV4/Index_new.aspx", { "flag": "submitLike", "isLike": isLike }, "POST", "submitLikeCartResult", "submitLikeCartResult");
}
function submitLikeCartResult() {
    $j('#dPopupLikeCart').slideUp(750, function () {
        $j('#dShadow').fadeOut(750);
    });
}
//$j(document).ready(function() {
//    $j('#ulSubTopMenu').spasticNav();
//    $j(window).resize(function() { resizeMenu(); });
//    window.onscroll = scrollMenu;
//});


//function resizeMenu() {
//    var large = false;
//    var medium = false;
//    var small = false;
//    var width = $j(window).width();
//    var num = 0;
//    if (width >= 1218) {
//        num = 0;
//        // large = true;
//    }
//    else if (width < 1218 && width >= 978) {
//        // medium = true;
//        num = 1;
//    } else if (width < 978) {
//        //small = true;
//        num = 2;
//    }
//    switch (num) {
//        case 0:
//            if (large == false) {
//                $j("#blob").remove();
//                $j('#ulSubTopMenu').spasticNav();
//                large = true;
//            }
//            medium = false; small = false;
//            break;
//        case 1:
//            if (medium != true) {
//                $j("#blob").remove();
//                $j('#ulSubTopMenu').spasticNav();
//                medium = true;
//            }
//            large = false;
//            small = false;
//            break;
//        case 2:
//            if (small != true) {
//                $j("#blob").remove();
//                $j('#ulSubTopMenu').spasticNav();
//                small = true;
//            }
//            large = false;
//            medium = false;
//            break;
//    }
//}


//function scrollMenu() {
//    var offsetY = typeof (window.pageYOffset) == 'number' ? window.pageYOffset : document.documentElement.scrollTop;
//    if (offsetY > 120) {
//        $j(".sectionEmail").addClass("scrollMenu");
//        //02/10 set vi tri popup addcart theo size window
//        if ($j(".newSP-cart")) {
//            $j(".newSP-cart").addClass("moveCart");
//            var position = $j(".mod-innerHeader").offset();
//            console.log(position.left)
//            $j(".newSP-cart").css({
//                right: position.left + 'px'
//            })
//        }
//        //end 02/10 set vi tri popup addcart theo size window
//    } else if (offsetY <= 120) {
//        $j(".sectionEmail").removeClass("scrollMenu");
//        //02/10 set vi tri popup addcart theo size window
//        if ($j(".newSP-cart")) {
//            $j(".newSP-cart").removeClass("moveCart");
//            $j(".newSP-cart").css({
//                right: "1px"
//            })
//        }
//        //end 02/10 set vi tri popup addcart theo size window
//    }
//}